home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 3 / Cream of the Crop 3.iso / comm / thor12.zip / FSEPGPSC.LHA / FSEPGPScripts / ESR.Doc < prev    next >
Text File  |  1993-09-14  |  3KB  |  96 lines

  1. ***************************************************************
  2.         Easy String Requester - ESR  V1.00
  3.             By Scott Ellis
  4.            (sellis@steer.sdsu.edu)
  5. ***************************************************************
  6.  
  7. What it Does:
  8.  
  9. ESR allows you to bring up a string gadget from a script or a command line,
  10. and return the value input to the requester to stdio (the shell or script).
  11.  
  12. What it Needs:
  13.  
  14. ReqTools library, and Kickstart 2.0 or higher.
  15.  
  16. Why it's Here:
  17.  
  18. I needed such a program for use with ToolManager 2.0, to make a few entries
  19. easier on myself.  I also never used ReadArgs() before, and wanted to play
  20. with it. ;-) Heck, someone else might find it useful too.
  21.  
  22. How to Use It:
  23.  
  24. Typing "ESR ?" brings up the usual command template.  Isn't the Amiga
  25. wonderful!  You should get the template:
  26.  
  27. BUFFER/A,TITLEBAR/A,MESSAGE/K:
  28.  
  29. BUFFER        What the default entry should be in the string gadget.
  30.         If the user just presses RETURN, or clicks on OK, then this
  31.         value will be returned.
  32.  
  33. TITLEBAR    What the titlebar of the window should say!
  34.  
  35. MESSAGE        ReqTools is very cool, and allows you to write a little
  36.         message above the string gadget.  This is really useful
  37.         if you need to include more text than will fit in the
  38.         titlebar, or if you want the text to be noticed.  I
  39.         don't know about you, but I hardly ever pay attention to
  40.         window titlebars. ;-)
  41.  
  42. If the user enters a valid string, presses RETURN, or clicks on OK, then it
  43. returns with ReturnCode of 0.  If CANCEL was selected, then the ReturnCode
  44. is set to 5.  Makes it a lot easier to use in scripts.
  45.  
  46. What to do with It:
  47.  
  48. Whatever you want!  My use for it was for use with networking software, and
  49. a few scripts I wrote for it.  With ToolManager 2.0 and ESR, it was trivial
  50. to make a decent interface for the AS225 software.  For example, to open
  51. an FTP connection, ToolManager calls FTP with the argument as the result of
  52. ESR.  This way all I do is type a hostname, and a connection is made.  Much
  53. more Amiga-ish than opening a shell first.
  54.  
  55. ftp `ESR "amiga.physik.unizh.ch" "Enter Destination" MESSAGE "Type something"`
  56.  
  57.  
  58. That's it!
  59.  
  60. ***
  61. *Note: It seems that quite a few people don't read manuals, and so miss out
  62. *on a very nice AmigaDOS feature.  Backquotes (`) allow programs to be executed,
  63. *and their result sent to the calling program.  For example:
  64. *
  65. *    Assign Foo: `ESR "Ram:" "Where is Foo:?"`
  66. *
  67. *This will allow the user to type in where he would like Foo: assigned, and
  68. *the result from ESR (Default is RAM: in this case) would be returned to the
  69. *assign command, so assign would "see" 'Assign Foo: Ram:'.
  70. ***
  71.  
  72. AmigaDOS 2.0 also allows you to give environment variables as arguments, so
  73. lets pretend that I usually have a variable set called MYNAME, and that
  74. USUALLY MYNAME is "fred".  Well, you can have ESR use MYNAME as the default,
  75. so if MYNAME is the name you want, just press RETURN, or click on OK.
  76. Here's an example:
  77.  
  78.     setenv CURRENTNAME `ESR $MYNAME "Enter a name:"`
  79.  
  80. This will set the variable CURRENTNAME to whatever is entered in the ESR
  81. gadget.  Make sense?  Of course it does! :-)
  82.  
  83. Anyhow, the program is useful, but simple. If you use it, great, if not,
  84. delete it.  No skin off my back. ;-)  If you want the source, drop me some
  85. E-mail, and I'll mail it to you...it's only about 1k.
  86.  
  87. ESR is also pure, so you can set the pure bit (Protect ESR +P), and make it
  88. resident if you wish.  No biggie.
  89.  
  90.  
  91.                 Scott Ellis
  92.                 sellis@steer.sdsu.edu
  93.                 Jan 1993
  94.  
  95.  
  96.